home *** CD-ROM | disk | FTP | other *** search
/ stazsoftware.com / www.stazsoftware.com.tar / www.stazsoftware.com / futurebasic / sample-code / PathName.sit / FSSpecToFullPath[(H) next >
Text File  |  2004-04-12  |  495b  |  35 lines

  1.  
  2.  
  3.  
  4. local fn FSSpecToFullPath( @fs as ^FSSpec)
  5. '~'9
  6.  
  7. dim @h as handle
  8. dim @p as ptr
  9. dim @FSRefPtr  as ptr
  10. dim x as long
  11.  
  12. _defaultPathBufferSize = 2048
  13. h = 0
  14.  
  15. long if ( fn FSpMakeFSRef( #fs, FSRefPtr  ) == _noErr )
  16. h = fn NewHandleClear(_defaultPathBufferSize)
  17. long if h
  18. HLock(h)
  19.  p = [h]
  20. long if ( fn FSRefMakePath( @FSRefPtr, #p, _defaultPathBufferSize ) == _noErr)
  21. x = 0
  22. HUnlock(h)
  23. while |[h] + x + 1| != 0
  24. x ++
  25. wend
  26. SetHandleSize(h , x)
  27. xelse
  28. def disposeh(h)
  29. end if
  30. end if
  31. end if
  32. end fn = h
  33.  
  34.  
  35.